import { FC } from 'react';
import { useSelector } from 'umi';

import { ListType } from '../models/models';

const List: FC = () => {
  const list = useSelector((state: any) => state.index.list);
  // const dispatch = useDispatch();
  // useEffect(() => {
  //   dispatch({
  //     type: 'index/load',
  //   });
  // }, [dispatch]);
  return (
    <ul>
      {list.map((item: ListType) => {
        return <li key={item.id}>{item.name}</li>;
      })}
    </ul>
  );
};

export default List;
